//
//  WYTCacheView.m
//  Diary
//
//  Created by 王艺拓 on 15/11/11.
//  Copyright © 2015年 王艺拓. All rights reserved.
//

#import "WYTCacheView.h"
#import "WYTDevicesTool.h"

@implementation WYTCacheView

- (instancetype)init{
    self = [super init];
    if (self) {
        [self setUpScenes];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

- (void)setUpScenes{
    self.descriptionLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth * 0.805 * 0.05, kScreenWidth * 0.805 * 0.05, kScreenWidth * 0.805 * 0.9, kScreenWidth * 0.805 * 0.65)];
    self.descriptionLabel.numberOfLines = 0;
    self.descriptionLabel.textAlignment = NSTextAlignmentCenter;
    self.descriptionLabel.text = @"清除缓存将删除您手机中的所有的日记卡片\n\n下滑返回设置";
    self.descriptionLabel.textColor = [UIColor grayColor];
    NSInteger descriptionLabelFontSize = 19;
    if ([WYTDevicesTool iPhone6_iPhone6s]) {
        descriptionLabelFontSize = 17;
    }else if ([WYTDevicesTool iPhone320_DEVICES]){
        descriptionLabelFontSize = 15;
    }
    self.descriptionLabel.font = [UIFont boldSystemFontOfSize:descriptionLabelFontSize];
    [self addSubview:self.descriptionLabel];
    
    self.confirmButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.confirmButton.frame = CGRectMake(CGRectGetMinX(self.descriptionLabel.frame), CGRectGetMaxY(self.descriptionLabel.frame), CGRectGetWidth(self.descriptionLabel.frame), kScreenWidth * 0.805 * 0.23);
    self.confirmButton.backgroundColor = [UIColor colorWithRed:253/255.0 green:218/255.0 blue:89/255.0 alpha:1.0f];
    self.confirmButton.titleLabel.font = [UIFont boldSystemFontOfSize:descriptionLabelFontSize];
    [self.confirmButton setTitle:@"确定清除" forState:UIControlStateNormal];
    self.confirmButton.layer.cornerRadius = 10.0;
    self.confirmButton.layer.masksToBounds = YES;
    [self addSubview:self.confirmButton];
}

@end
